package main

import "fmt"

func findRepeatNumber(nums []int) int {
    index := 0;
    for index < len(nums) {
        if nums[index] == index {
            index++
            continue
        }
        if nums[index] == nums[nums[index]] {
            return nums[index]
        }
        nums[nums[index]], nums[index] = nums[index], nums[nums[index]]
    }
    return -1
}

func main() {
    arr := []int{2, 3, 1, 0, 2, 5, 3}
    r := findRepeatNumber(arr)
    fmt.Println(r)
}


